'''
Created on Aug 28, 2012

@author: wt

This class handle the staff information on server
'''
import webapp2
from google.appengine.ext import db
from xs.data.StaffEntity import StaffEntity
import simplejson

class test(db.Model):
    name = db.StringProperty()
    
class Staff(webapp2.RequestHandler):
    def get(self):
        result = {}
        result['staff'] = []
        entities = StaffEntity.all()
        for entity in entities:
            result['staff'].append({'id':entity.key().id_or_name(),'name':entity.name,'email':entity.email})
        result['success'] = True
        self.response.out.write(simplejson.dumps(result))
        
    def post(self):
        result = {}
        result['success'] = False
        self.response.out.write(simplejson.dumps(result))
